package com.mxl.rabbitmq.consumer;

import com.alibaba.fastjson.JSON;
import com.mxl.rabbitmq.config.DirectConfig;
import com.mxl.rabbitmq.model.MessageBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Direct队列消费者
 * @author MXL
 * @date 2021/9/14 0014
 **/
@Component
@Slf4j
public class DirectReceiver {

    @RabbitListener(queues = DirectConfig.QUEUE_NAME_DIRECT)
    public void process(MessageBody messageBody) {
        log.info("Direct-Receiver消费者收到消息  : " + JSON.toJSONString(messageBody));
    }

}
